let arr1=new Set([1,2,3,1,2]);
let arr2=new Set([4,5,6,2,4]);
//交集
// let newArr=new Set([...arr1].filter(x=>arr2.has(x)));
//并集
let newArr=new Set([...arr1,...arr2]);
console.log(newArr);